<template>
  <div class="comments">
    <div class="avatar">
      <el-avatar class="user-avater"
                 size="medium"
                 :src="avatar+'?param=80y80'"></el-avatar>
    </div>
    <div class="content">
      <p class="comment-text">
        <span class="username">{{username}}:</span>
        <span class="text">{{text}}</span>
      </p>

      <div class="replied"
           v-if="replied.length>0">
        <p class="comment-text"
           v-for="item,index in replied"
           :key="index">
          <span class="username">{{item.user.nickname}}:</span>
          <span class="text">{{item.content}}</span>
        </p>
      </div>
      <div class="bottom">
        <span class="date">{{date | dateFormat}}</span>
        <div class="actions">
          <i class="iconfont el-icon-thumb"></i>
          {{actions}}
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    avatar: String,
    username: String,
    text: String,
    replied: Array,
    date: Number,
    actions: Number

  },
  data () {
    return {
    }
  },
  created () { },
  mounted () { },
  methods: {}
}
</script>
 <style lang='less' scoped>
.comments {
  padding-top: 0.146413rem;
  display: flex;
  .avatar {
    width: 0.292826rem;
    height: 0.292826rem;
    margin-right: 0.087848rem;
  }
  .content {
    flex: 1;
    padding-bottom: 0.146413rem;
    border-bottom: 1px solid #f2f2f1;
    font-size: 0.087848rem;
    .comment-text {
      margin: 0;
      .username {
        color: #517eaf;
        margin-right: 0.029283rem;
      }
    }
  }
  .replied {
    margin-top: 0.058565rem;
    padding: 0.058565rem;
    border-radius: 0.036603rem;
    background-color: #e6e5e6;
  }
  .bottom {
    margin-top: 0.058565rem;
    display: flex;
    justify-content: space-between;
    color: #bebebe;
    .actions {
      cursor: pointer;
    }
  }
}
</style>
